package com.zdx.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class CallController {
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/call/sayHello")
    public String callSayHello(){
        return restTemplate.getForObject("http://eureka-client-user-service/sayHello",String.class);
    }

    @GetMapping("/call/sayHello1")
    public String callSayHello1(){
        return restTemplate.getForObject("http://eureka-server/sayHello",String.class);
    }
}
